package com.newgoldcurrency.activities.main;

import android.content.Intent;
import android.os.Bundle;
import android.os.SystemClock;

import androidx.appcompat.app.AppCompatActivity;

import com.newgoldcurrency.databinding.ActivityChain2Binding;

public class Chain2Activity extends AppCompatActivity {

    private ActivityChain2Binding binding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = ActivityChain2Binding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        binding.chain2Back.setOnClickListener(v -> finish());
        binding.chain2Submit.setOnClickListener(v -> {
            if (checkDoubleClick()){
                startActivity(new Intent(Chain2Activity.this,Chain3Activity.class));
            }
        });
    }
    private long mClickTime;
    private boolean checkDoubleClick() {
        boolean result= mClickTime < SystemClock.uptimeMillis() - 500;
        mClickTime = SystemClock.uptimeMillis();
        return result;
    }
    @Override
    protected void onDestroy() {
        super.onDestroy();
        binding=null;
    }
}